Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support delta brave_installer #5484

Merged
merged 1 commit into from
May 19, 2020
Merged

Support delta brave_installer #5484

merged 1 commit into from
May 19, 2020

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented May 7, 2020

In this PR, two new sub options are added to create_dist command like below.
last_chrome_installer is used to pass folder that contains previous version's uncompressed chrome.7z file.
Courgette generate diff file based on previous version's chrome.7z file with newly built chrome.7z.

npm run create_dist Release -- --build_delta_installer --last_chrome_installer="C:/build/installer"

This PR should be merged with brave/brave-browser#9667.

Resolves brave/brave-browser#9565

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@simonhong simonhong force-pushed the delta_installer_win branch 3 times, most recently from fddc682 to 7a2fed8 Compare May 8, 2020 09:04
cmd = [lzma_exec,
'x',
- '-o"%s"' % temp_dir,
+ '-o%s' % temp_dir,
Copy link
Member Author

@simonhong simonhong May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W/o this change, lzma_exec generates temp_dir under c:/ instead of using cwd's one.

Copy link
Member

@bsclifton bsclifton May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ever possible for temp_dir to have spaces? If so, you might try something like -o.\"%s"' % temp_dir

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks for catching. It would be much safer.
Changed to -o./"%s" % temp_dir.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand why this is needed, how does it work for chrome?

Copy link
Member Author

@simonhong simonhong May 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussing with @bridiver , This is reverted to '-o%s' % temp_dir, because relative path in out doesn't have space.
and asked about this in chromium shared slack channel.

def GenerateDiffPatch(options, orig_file, new_file, patch_file):
if (options.diff_algorithm == "COURGETTE"):
- exe_file = os.path.join(options.last_chrome_installer, COURGETTE_EXEC)
+ exe_file = os.path.join(options.build_dir, COURGETTE_EXEC)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last_chrome_installer is directory that contains previous version's installer dir.
courgettes exe is generated in ./out.

Copy link
Member Author

@simonhong simonhong May 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can avoid this patch if we copy courgette.exe from out/Release to folder indicated by last_chrome_installer before running build_delta_installer by Jenkins job. cc @mihaiplesa

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is deleted.
courgette.exe will be copied from out/Release to last_chrome_installer by pipeline.

@simonhong simonhong self-assigned this May 8, 2020
@simonhong simonhong added this to the 1.10.x - Nightly milestone May 8, 2020
@simonhong simonhong force-pushed the delta_installer_win branch from 7a2fed8 to bfb1971 Compare May 8, 2020 09:29
@simonhong simonhong marked this pull request as ready for review May 8, 2020 09:30
@simonhong simonhong requested a review from bridiver as a code owner May 8, 2020 09:30
@mihaiplesa mihaiplesa force-pushed the delta_installer_win branch 2 times, most recently from fac49c7 to 0d1d684 Compare May 12, 2020 20:48
@mihaiplesa mihaiplesa added the CI/skip Do not run CI builds (except noplatform) label May 12, 2020
@simonhong simonhong force-pushed the delta_installer_win branch 2 times, most recently from b31cbb7 to e960833 Compare May 13, 2020 08:05
@simonhong simonhong force-pushed the delta_installer_win branch 2 times, most recently from b4c5420 to f6a5108 Compare May 13, 2020 08:30
cmd = [lzma_exec,
'x',
- '-o"%s"' % temp_dir,
+ '-o./"%s"' % temp_dir,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned here - #5484 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem here is what we're passing in for last_chrome_installer because we shouldn't have to change the script itself. We should be passing in a a rebased value here https://github.com/brave/brave-core/pull/5484/files#diff-769a945034c01d9bc9d33ecfa819c902R18

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I guess this is staging_dir, but in any case this should be running in the root build dir so there's no reason for it to end up in the root of the filesystem

BUILD.gn Outdated
# before running create_dist with build_delta_installer.
# When mini_installer target generates diff installer patch, it assumes
# that courgette.exe is already in last_chrome_installer folder.
deps += [ "//courgette:copy_courgette_binaries" ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place to put this. https://github.com/brave/brave-core/pull/5484/files#diff-769a945034c01d9bc9d33ecfa819c902R20 should be consolidated into a single dep on //brave/installer/mini_installer which has deps for courgette:copy_courgette_binaries conditionally on build_delta_installer and then on //brave instead of //brave:packed_resources and //brave/build/win:copy_exe

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this list is incomplete and can be eliminated by just making the target dependent on //brave https://github.com/brave/brave-core/pull/5484/files#diff-769a945034c01d9bc9d33ecfa819c902R19

@simonhong simonhong force-pushed the delta_installer_win branch 2 times, most recently from 9a2c6b2 to 73a3f12 Compare May 14, 2020 02:35
@simonhong simonhong removed the CI/skip Do not run CI builds (except noplatform) label May 14, 2020
@simonhong simonhong force-pushed the delta_installer_win branch 2 times, most recently from a981e06 to a72b7ee Compare May 14, 2020 04:29
Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should fix the path in gn, not patch the script https://github.com/brave/brave-core/pull/5484/files#r425343559

@simonhong simonhong force-pushed the delta_installer_win branch from a72b7ee to 28cfe06 Compare May 15, 2020 01:20
@simonhong simonhong force-pushed the delta_installer_win branch from 28cfe06 to ee0f732 Compare May 15, 2020 03:03
By using additional options (--build_delta_installer and
--last_chrome_installer) with create_dist command, we can build
delta installer on Windows.
@simonhong simonhong force-pushed the delta_installer_win branch from ee0f732 to 593ed79 Compare May 19, 2020 00:58
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ as this was previously approved; changes to lzma_exec LGTM!

@simonhong simonhong merged commit 0f31032 into master May 19, 2020
@simonhong simonhong deleted the delta_installer_win branch May 19, 2020 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support delta installer for updates on Windows
4 participants